\(\int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx\) [675]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 39, antiderivative size = 55 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=\frac {a (A-i B)}{5 c^5 f (i+\tan (e+f x))^5}+\frac {a B}{4 c^5 f (i+\tan (e+f x))^4} \]

[Out]

1/5*a*(A-I*B)/c^5/f/(I+tan(f*x+e))^5+1/4*a*B/c^5/f/(I+tan(f*x+e))^4

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45} \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=\frac {a (A-i B)}{5 c^5 f (\tan (e+f x)+i)^5}+\frac {a B}{4 c^5 f (\tan (e+f x)+i)^4} \]

[In]

Int[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^5,x]

[Out]

(a*(A - I*B))/(5*c^5*f*(I + Tan[e + f*x])^5) + (a*B)/(4*c^5*f*(I + Tan[e + f*x])^4)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(c-i c x)^6} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {(a c) \text {Subst}\left (\int \left (\frac {-A+i B}{c^6 (i+x)^6}-\frac {B}{c^6 (i+x)^5}\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {a (A-i B)}{5 c^5 f (i+\tan (e+f x))^5}+\frac {a B}{4 c^5 f (i+\tan (e+f x))^4} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.68 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.75 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=\frac {a (4 A+i B+5 B \tan (e+f x))}{20 c^5 f (i+\tan (e+f x))^5} \]

[In]

Integrate[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^5,x]

[Out]

(a*(4*A + I*B + 5*B*Tan[e + f*x]))/(20*c^5*f*(I + Tan[e + f*x])^5)

Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.82

method result size
derivativedivides \(\frac {a \left (-\frac {i B -A}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}+\frac {B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}\right )}{f \,c^{5}}\) \(45\)
default \(\frac {a \left (-\frac {i B -A}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}+\frac {B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}\right )}{f \,c^{5}}\) \(45\)
risch \(-\frac {a \,{\mathrm e}^{10 i \left (f x +e \right )} B}{160 c^{5} f}-\frac {i a \,{\mathrm e}^{10 i \left (f x +e \right )} A}{160 c^{5} f}-\frac {{\mathrm e}^{8 i \left (f x +e \right )} a B}{64 c^{5} f}-\frac {i {\mathrm e}^{8 i \left (f x +e \right )} A a}{32 c^{5} f}-\frac {i A a \,{\mathrm e}^{6 i \left (f x +e \right )}}{16 c^{5} f}+\frac {{\mathrm e}^{4 i \left (f x +e \right )} a B}{32 c^{5} f}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )} A a}{16 c^{5} f}+\frac {a \,{\mathrm e}^{2 i \left (f x +e \right )} B}{32 c^{5} f}-\frac {i a \,{\mathrm e}^{2 i \left (f x +e \right )} A}{32 c^{5} f}\) \(178\)

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x,method=_RETURNVERBOSE)

[Out]

1/f*a/c^5*(-1/5*(-A+I*B)/(I+tan(f*x+e))^5+1/4*B/(I+tan(f*x+e))^4)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 94 vs. \(2 (45) = 90\).

Time = 0.24 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.71 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=-\frac {2 \, {\left (i \, A + B\right )} a e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, {\left (2 i \, A + B\right )} a e^{\left (8 i \, f x + 8 i \, e\right )} + 20 i \, A a e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, {\left (2 i \, A - B\right )} a e^{\left (4 i \, f x + 4 i \, e\right )} + 10 \, {\left (i \, A - B\right )} a e^{\left (2 i \, f x + 2 i \, e\right )}}{320 \, c^{5} f} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x, algorithm="fricas")

[Out]

-1/320*(2*(I*A + B)*a*e^(10*I*f*x + 10*I*e) + 5*(2*I*A + B)*a*e^(8*I*f*x + 8*I*e) + 20*I*A*a*e^(6*I*f*x + 6*I*
e) + 10*(2*I*A - B)*a*e^(4*I*f*x + 4*I*e) + 10*(I*A - B)*a*e^(2*I*f*x + 2*I*e))/(c^5*f)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 348 vs. \(2 (42) = 84\).

Time = 0.39 (sec) , antiderivative size = 348, normalized size of antiderivative = 6.33 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=\begin {cases} \frac {- 10485760 i A a c^{20} f^{4} e^{6 i e} e^{6 i f x} + \left (- 5242880 i A a c^{20} f^{4} e^{2 i e} + 5242880 B a c^{20} f^{4} e^{2 i e}\right ) e^{2 i f x} + \left (- 10485760 i A a c^{20} f^{4} e^{4 i e} + 5242880 B a c^{20} f^{4} e^{4 i e}\right ) e^{4 i f x} + \left (- 5242880 i A a c^{20} f^{4} e^{8 i e} - 2621440 B a c^{20} f^{4} e^{8 i e}\right ) e^{8 i f x} + \left (- 1048576 i A a c^{20} f^{4} e^{10 i e} - 1048576 B a c^{20} f^{4} e^{10 i e}\right ) e^{10 i f x}}{167772160 c^{25} f^{5}} & \text {for}\: c^{25} f^{5} \neq 0 \\\frac {x \left (A a e^{10 i e} + 4 A a e^{8 i e} + 6 A a e^{6 i e} + 4 A a e^{4 i e} + A a e^{2 i e} - i B a e^{10 i e} - 2 i B a e^{8 i e} + 2 i B a e^{4 i e} + i B a e^{2 i e}\right )}{16 c^{5}} & \text {otherwise} \end {cases} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**5,x)

[Out]

Piecewise(((-10485760*I*A*a*c**20*f**4*exp(6*I*e)*exp(6*I*f*x) + (-5242880*I*A*a*c**20*f**4*exp(2*I*e) + 52428
80*B*a*c**20*f**4*exp(2*I*e))*exp(2*I*f*x) + (-10485760*I*A*a*c**20*f**4*exp(4*I*e) + 5242880*B*a*c**20*f**4*e
xp(4*I*e))*exp(4*I*f*x) + (-5242880*I*A*a*c**20*f**4*exp(8*I*e) - 2621440*B*a*c**20*f**4*exp(8*I*e))*exp(8*I*f
*x) + (-1048576*I*A*a*c**20*f**4*exp(10*I*e) - 1048576*B*a*c**20*f**4*exp(10*I*e))*exp(10*I*f*x))/(167772160*c
**25*f**5), Ne(c**25*f**5, 0)), (x*(A*a*exp(10*I*e) + 4*A*a*exp(8*I*e) + 6*A*a*exp(6*I*e) + 4*A*a*exp(4*I*e) +
 A*a*exp(2*I*e) - I*B*a*exp(10*I*e) - 2*I*B*a*exp(8*I*e) + 2*I*B*a*exp(4*I*e) + I*B*a*exp(2*I*e))/(16*c**5), T
rue))

Maxima [F(-2)]

Exception generated. \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 260 vs. \(2 (45) = 90\).

Time = 0.97 (sec) , antiderivative size = 260, normalized size of antiderivative = 4.73 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=-\frac {2 \, {\left (5 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 20 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} - 5 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} - 60 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 10 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 100 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 25 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 126 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 24 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 100 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 25 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 60 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 10 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 20 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 5 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 5 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{5 \, c^{5} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{10}} \]

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^5,x, algorithm="giac")

[Out]

-2/5*(5*A*a*tan(1/2*f*x + 1/2*e)^9 + 20*I*A*a*tan(1/2*f*x + 1/2*e)^8 - 5*B*a*tan(1/2*f*x + 1/2*e)^8 - 60*A*a*t
an(1/2*f*x + 1/2*e)^7 - 10*I*B*a*tan(1/2*f*x + 1/2*e)^7 - 100*I*A*a*tan(1/2*f*x + 1/2*e)^6 + 25*B*a*tan(1/2*f*
x + 1/2*e)^6 + 126*A*a*tan(1/2*f*x + 1/2*e)^5 + 24*I*B*a*tan(1/2*f*x + 1/2*e)^5 + 100*I*A*a*tan(1/2*f*x + 1/2*
e)^4 - 25*B*a*tan(1/2*f*x + 1/2*e)^4 - 60*A*a*tan(1/2*f*x + 1/2*e)^3 - 10*I*B*a*tan(1/2*f*x + 1/2*e)^3 - 20*I*
A*a*tan(1/2*f*x + 1/2*e)^2 + 5*B*a*tan(1/2*f*x + 1/2*e)^2 + 5*A*a*tan(1/2*f*x + 1/2*e))/(c^5*f*(tan(1/2*f*x +
1/2*e) + I)^10)

Mupad [B] (verification not implemented)

Time = 8.66 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.49 \[ \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx=\frac {\frac {a\,\left (4\,A+B\,1{}\mathrm {i}\right )}{20}+\frac {B\,a\,\mathrm {tan}\left (e+f\,x\right )}{4}}{c^5\,f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^5+{\mathrm {tan}\left (e+f\,x\right )}^4\,5{}\mathrm {i}-10\,{\mathrm {tan}\left (e+f\,x\right )}^3-{\mathrm {tan}\left (e+f\,x\right )}^2\,10{}\mathrm {i}+5\,\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )} \]

[In]

int(((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i))/(c - c*tan(e + f*x)*1i)^5,x)

[Out]

((a*(4*A + B*1i))/20 + (B*a*tan(e + f*x))/4)/(c^5*f*(5*tan(e + f*x) - tan(e + f*x)^2*10i - 10*tan(e + f*x)^3 +
 tan(e + f*x)^4*5i + tan(e + f*x)^5 + 1i))